package com.bigboy.bbs.util;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;

public class OnLineList implements HttpSessionAttributeListener {
	private static List onlineList = new ArrayList(); 
	public void attributeAdded(HttpSessionBindingEvent se) {
		if("user".equals(se.getName())){
			onlineList.add(se.getValue());
		}
	}

	public void attributeRemoved(HttpSessionBindingEvent se) {
		if("user".equals(se.getName())){
			onlineList.remove(se.getValue());
		}
	}

	public void attributeReplaced(HttpSessionBindingEvent se) {

	}
	public static List getList(){
		return onlineList;
	}
}
